package vip.xiaonuo.invoice.modular.param;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 发票请求参数
 *
 * @author AI Assistant
 */
@Getter
@Setter
public class InvoiceRequestParam {

    @Schema(description = "发票类型")
    private String invoiceType;

    @Schema(description = "含税标志 0:不含税 1:含税")
    private String includeTaxFlag;

    @Schema(description = "销方名称")
    private String sellerName;

    @Schema(description = "销方电话")
    private String sellerPhone;

    @Schema(description = "销方税号")
    private String sellerTaxNumber;

    @Schema(description = "销方地址")
    private String sellerAddress;

    @Schema(description = "销方银行账号")
    private String sellerBankAccount;

    @Schema(description = "购方名称")
    @NotBlank(message = "购方名称不能为空")
    private String buyerName;

    @Schema(description = "购方电话")
    private String buyerPhone;

    @Schema(description = "购方税号")
    private String buyerTaxNumber;

    @Schema(description = "购方地址")
    private String buyerAddress;

    @Schema(description = "购方银行账号")
    private String buyerBankAccount;

    @Schema(description = "发票接收邮箱")
    private String receiveEmail;

    @Schema(description = "发票接收手机号")
    private String receivePhone;

    @Schema(description = "商品明细列表")
    private List<Item> itemList;

    @Schema(description = "特定要素类型代码")
    private String specialTypeCode;

    @Schema(description = "不动产经营租赁服务")
    private RealEstateInfo realEstateInfo;

    @Schema(description = "回调URL")
    private String callbackUrl;

    @Schema(description = "备注信息")
    private String remark;

    @Getter
    @Setter
    public static class Item {

        /**
         * 商品名称
         */
        @Schema(description = "商品名称")
        private String productName;

        /**
         * 商品编码
         */
        @Schema(description = "商品编码")
        private String productCode;

        /**
         * 金额
         */
        @Schema(description = "金额")
        private String amount;

        /**
         * 税率
         */
        @Schema(description = "税率")
        private String taxRate;

//
//        @Schema(description = "税额")
//        private String tax;


        @Schema(description = "优惠政策标识 0 未使用，1 使用，默认为0")
        private String preferentialPolicyMark;


        @Schema(description = "0税率标识")
        private String zeroTaxRateMark;


//        @Schema(description = "数量")
//        private String quantity;
//
//
//        @Schema(description = "单价")
//        private String unitPrice;

    }


    /**
     * 不动产经营租赁服务
     */
    @Getter
    @Setter
    public static class RealEstateInfo {

        /**
         * 房屋产权证书/不动产权证号码
         */
        @Schema(description = "房屋产权证书/不动产权证号码")
        private String certificate;
        /**
         * 不动产地址
         */
        @Schema(description = "不动产地址")
        private String address;

        /**
         * 面积单位
         */
        @Schema(description = "面积单位")
        private String areaUnit;

        /**
         * 租赁期起
         */
        @Schema(description = "租赁期起")
        private String startRentalTime;

        /**
         * 租赁期止
         */
        @Schema(description = "租赁期止")
        private String endRentalTime;

        /**
         * 跨地市标志
         */
        @Schema(description = "跨地市标志，0：否  1：是  ")
        private String crossCityFlag;
    }
}
